unit MultiClassMethod_cxPageControl;

interface
uses
  {$IF CompilerVersion<16}
  Graphics,
  {$ELSE}
  VCL.Graphics,
  {$IFEND}
  Classes,SysUtils,Variants,
  AcroMultiClassMethod,
  cxPC;

implementation
type
  TcxPageControl_Temp=class(TcxPageControl);

procedure Proc_TcxPageControl(ATable:IDataLocate; AComponent:TObject; ALCID,ASeqNo:String; AParams:TStringList);
var
  i:integer;
begin
  TcxPageControl_Temp(AComponent).Tabs.BeginUpdate;
  try
    for i:=0 to TcxPageControl(AComponent).PageCount-1 do
      TcxPageControl(AComponent).Pages[i].Caption :=
        GetDisplayValue(ATable,TcxPageControl(AComponent).Pages[i].Caption, ALCID, ASeqNo,
          TcxPageControl(AComponent).Pages[i],'Caption');
  finally
    TcxPageControl_Temp(AComponent).Tabs.EndUpdate;
  end;
end;

procedure Proc_TcxTabControl(ATable:IDataLocate; AComponent:TObject; ALCID,ASeqNo:String; AParams:TStringList);
var
  i:integer;
begin
  TcxTabControl(AComponent).Tabs.BeginUpdate;
  try
    for i:=0 to TcxTabControl(AComponent).Tabs.Count-1 do
      TcxTabControl(AComponent).Tabs[i].Caption :=
        GetDisplayValue(ATable,TcxTabControl(AComponent).Tabs[i].Caption, ALCID, ASeqNo,
          TcxTabControl(AComponent).Tabs[i],'Caption');
  finally
    TcxTabControl(AComponent).Tabs.EndUpdate;
  end;
end;

initialization
  AcroClassMethodStorage.RegisterClassMethod(TcxPageControl                , Proc_TcxPageControl);
  AcroClassMethodStorage.RegisterClassMethod(TcxTabControl                 , Proc_TcxTabControl);
finalization
  AcroClassMethodStorage.UnRegisterClassMethod(TcxPageControl);
  AcroClassMethodStorage.UnRegisterClassMethod(TcxTabControl);
end.
